<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='盘点单明细', subtext='管理系统中盘点单明细数据'">

<head>
  <title>盘点单明细</title>
</head>
<body>
  
  <th:block layout:fragment="content">
    <div class="box-body m-b-sm border-bottom">
      <form class="form-horizontal search-form" role="form" th:object="${r}" novalidate="novalidate" >
        <div class="row">
         		<div class="col-sm-3">
	          	<div class="form-group">
	              <label class="control-label col-lg-5">单号</label>
	              <label class="form-control-static" id='documentNumber'>[[*{documentNumber}]]</label>
	            </div>
	        </div>
	        <div class="col-sm-3">
	          	<div class="form-group">
	              <label class="control-label col-lg-5">类型</label>
	              <label class="form-control-static" id='type'>[[${@CODES.textByValue('CO_TYPE', r.type)}]]</label>
	            </div>
	        </div>
	        <div class="col-sm-3">
	          	<div class="form-group">
	              <label class="control-label col-lg-5">盘点时间</label>
	              <label class="form-control-static" id='expectedTime'>[[${#calendars.format(r.expectedTime, 'yyyy-MM-dd HH:mm:ss')}]]</label>
	            </div>
	        </div>
	        <div class="col-sm-3">
	          	<div class="form-group">
	              <label class="control-label col-lg-5">状态</label>
	              <label class="form-control-static" id='status'>[[${@CODES.textByValue('CO_STATUS', r.status)}]]</label>
	            </div>
	        </div>
	    </div>
      </form>
    </div>

    <div class="row">
      <div class="col-lg-12">
        <div class="box">
          <div class="box-body">
            <h2>
                <!--
              <a  class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/add|}" th:title="添加盘点单明细">
                <i class="fa fa-fw fa-plus"></i> 添加
              </a>
              -->
              <a  class="btn btn-primary btn-sm countSameAll" href="javascript:;" th:title="盘点完成，数量一致">
                <i class="fa fa-fw fa-plus"></i> 盘点相符
              </a>
              <a  class="btn btn-primary btn-sm countDiffReqAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/countdiff|__')}" th:title="盘点数量存在差异">
                 <i class="fa fa-fw fa-tasks"></i> 盘点差异
              </a>

                <!--
              <a  class="btn btn-primary btn-sm checkAll" href="javascript:;" th:title="重新生成盘点任务，再次盘点">
                  <i class="fa fa-fw fa-plus"></i> 复盘
              </a>
              <a  class="btn btn-primary btn-sm checkSameAll" href="javascript:;" th:title="复盘完成，数量一致">
                <i class="fa fa-fw fa-plus"></i> 复盘相符
              </a>
              <a  class="btn btn-primary btn-sm checkDiffReqAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/checkdiff|__')}" th:title="复盘数量存在差异">
                <i class="fa fa-fw fa-tasks"></i> 盘点差异
              </a>
                 -->
              <a  class="btn btn-danger btn-sm delAll" href="javascript:;" th:title="删除盘点单明细">
                <i class="fa fa-fw fa-trash"></i> 删除
              </a>
                <!--
             <a class="btn btn-default back" th:href="@{|/inventory/co|}" th:title="返回盘点单证">
               <i class="fa fa-fw fa-reply"></i> 返回单证
             </a>
                -->
           </h2>
           <div id="tableWrapper">
             <table id="table" class="table table-striped table-hover">
               <thead>
                 <tr>
                   <th>HeaderId</th>
                   <th style="width:40px;">
                     <a href="javascript:;" class="selectAll" title="全选">全选</a>
                   </th>


                   <th style="width:80px;">单号</th>
                   <th style="width:50px;">行号</th>
                   <th style="width:80px;">物料编码</th>
                   <th style="width:160px;">物料名称</th>
                   <th style="width:80px;">供应商</th>
                   <th style="width:100px;">WBS</th>
                   <th style="width:80px;">库位</th>
                   <th style="width:100px;">容器编码</th>
                   <th style="width:80px;">库存数量</th>
                   <th style="width:80px;">盘点数量</th>
                   <th style="width:120px;">盘点时间</th>
                   <th style="width:80px;">盘点人</th>
                   <th style="width:100px;">盘点说明</th>

                   <th style="width:60px;">状态</th>
                   <th style="width:100px;">操作</th>

                 </tr>
               </thead>
               <tbody>
               </tbody>
             </table>
           </div>
         </div>
       </div>
     </div>
   </div>

   <form id="countSameForm" method="post" style="display: none" th:action="@{|${baseUrl}/countsame|}">
      <input id="ids" type="hidden" name="ids" />
   </form>

   <form id="countDiffReqForm" method="post" style="display: none" th:action="@{|${baseUrl}/countdiffreq|}">
         <input id="ids" type="hidden" name="ids" />
   </form>

   <form id="checkSameForm" method="post" style="display: none" th:action="@{|${baseUrl}/checksame|}">
      <input id="ids" type="hidden" name="ids" />
   </form>


   <form id="delForm" method="post" style="display: none" th:action="@{|${baseUrl}/del|}">
       <input id="ids" type="hidden" name="ids" />
   </form>



 </th:block>
 <th:block layout:fragment="scripts">
   <script th:inline="javascript">
     // 后端传入前端使用的变量JS中定义
     var headerId = /*[[${params['headerId']}]]*/ '';
     var status = /*[[${r.status}]]*/ '';
     var VALUES_MAP_DICT_TYPE = /*[[${@CODES.valuesMapOfType('CO_STATUS')}]]*/ {};

   </script>
   <script th:src="@{|${theme}/js/app/inventory/codetails_list.js?v=${applicationVersion}|}" th:inline="javascript"></script>
 </th:block>
</body>

</html>
